package com.example.service;

import com.example.entity.*;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface OperationService {
    void commit();
    void rollback();
    //机票操作
    Ticket getTicketById(int ticketId);
    int cancelTicket(int ticketId);
    int getPassengersByOrderId(int orderId);
    int reducePassengerPriceOrder(int orderId, double price);
    int cancelOrder(int orderId, String cancelDate);
    int refundOrder(int orderId, String refundDate);
    int addEconomySpaceByFid(int f_id);
    int addBusinessSpaceByFid(int f_id);
    int addFirstSpaceByFid(int f_id);
    int reducePassengerOrderNumByPassengerId(String ID_type, String ID_card);
    int refundTicket(int t_id);
    int setOrderIdinTicket(int t_id);
    Flight getFlightById(int f_id);
    //改签
    Order getOrderById(int orderId);
    User getUserById(int userId);
    FlightStatus getFlightStatusById(int f_id);
    int refundMoneyByUserIDtypeAndIDcard(String ID_type, String ID_card, double money);
    int deleteTicket(int t_id);
    int reduceEconomySpaceByFid(int f_id);
    int reduceBusinessSpaceByFid(int f_id);
    int reduceFirstSpaceByFid(int f_id);
    int addOrder(int userId,String user_name, int flightNo, String airline, String date, String from, String to, String departure, String arrival, double price, int passengers, String status,String statusText, String paymentMethod, String paymentDate);
    int getLastOrderId();
    int addTicket(int orderId, int passengerId, String passengerName, String passengerType, int flightNo, String date, double price, String seatType,String status, String statusText);
    int deleteOrder(int o_id);
    int reduceMoneyByUserIDtypeAndIDcard(String ID_type, String ID_card, double money);

    //订单操作
    List<Ticket> getTicketsByOrderId(int o_id);
    //支付
    int scheduledTicketStatus(int o_id);
    int payOrder(int orderId, String paymentDate, String paymentMethod);

    //管理员
    int cancelTicketByOrderId(int o_id);
    int payOrderNoDate(int orderId);
    //延误
    int delayTicketByFlightId(int f_id);
    int delayFlightStatusByFlightId(int f_id);
    List<Ticket> getTicketsByFlightId(int f_id);
    String getEmailByPassengerId(int passenger_id);
    //删除
    int deleteFlight(int f_id);
    int deleteFlightStatus(int f_id);
    int deleteTicketByFlightId(int f_id);
    int deleteOrderByFlightId(int f_id);
    int deletePlane(int p_id);
    //编辑
    FlightWithStatus getFlightWithStatus(int f_id);
    int editFlight(int f_id, String gate,String departure_date, String arrival_date, String departure_time, String arrival_time, double distance, double economy_price, double business_price,double first_price, int baggage_limit, String meal_money, String meal);
    int editFlightStatus(int f_id,String status, String captain, String assistant_captain, String chief_attendant, int flight_crew_num);

    //起飞
    int flightStart(int f_id);
    void ticketFlightStart(int f_id);
    void orderFlightStart(int f_id);
    //到达
    int flightArrive(int f_id);
}
